<?php
class cmshopapi_GetTags extends cmshopApi_base
{
    var $verb='GetTags';
    var $fields=array(
        
    );
    function Request(){
        if(!$this->checkAuthToken()) throw new Exception_AuthTokenInvalidate('');
        die($this->Response());
        return false;
    }
    
    // 回给 客户  .
    function Response($attach=null){
        $ts=Taggoods::all($this->token['store_id']);
        if(count($ts)){ foreach($ts as $t){
            $xmlArr_t[]=array(
                'tag_id'=>$t->tag_id,
                'name'=>$t->tag_name,
            );
        }}
        $xmlArr=array(
            'Ack'=>'Success',
            'timestamp'=>$this->dateTime(),
            'tags'=>$xmlArr_t,
		);
		if(is_array($attach)){
            $xmlArr=$xmlArr+$attach;
        }
        return $this->xmlresponse($xmlArr);
    }
}